import requests
from util.font import get_font_maps

font_maps = get_font_maps("./static/fonts/file")

def parse_fild(value):
    s = value
    result = ""
    for item in s.split("&")[1:]:
        # 使用 get 方法，如果找不到映射就显示原字符
        # print(char_code)
        result += font_maps[int(item[2:],base=16)]
        # print(font_maps.get(char_code))
    return result


res = requests.get('https://www.shixiseng.com/app/interns/search/v2?build_time=1763366855597&page=1&type=intern&keyword=&area=&months=&days=&degree=&official=&enterprise=&salary=-0&publishTime=&sortType=&city=%E5%85%A8%E5%9B%BD&internExtend=', headers={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36'
})

for item in res.json()['msg']['data']:
    print(item['cname'], item['industry'], parse_fild(item['maxsal']), parse_fild(item['minsal']))